package com.xci.sys.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.xci.core.domain.BaseEntity;
import com.xci.core.internal.Const;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
 * 系统登录日志
 * @author 吕艳阳
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "系统登录日志")
public class SysLoginLog extends BaseEntity {
	/**
	 * 主键
	 */
	@ExcelIgnore @Excel(name = "主键", width = 20d)
	@ApiModelProperty(value = "主键", required = true, position = 1)
	private String id;

	/**
	 * 登录账号
	 */
	@NotBlank(message = "请输入登录账号")
	@Length(max = 100, message = "登录账号长度不能超过{max}")
	@Excel(name = "登录账号", width = 20d)
	@ApiModelProperty(value = "登录账号", required = true, position = 2)
	private String account;

	/**
	 * 登录地址
	 */
	@Length(max = 100, message = "登录地址长度不能超过{max}")
	@Excel(name = "登录地址", width = 20d)
	@ApiModelProperty(value = "登录地址", position = 3)
	private String ipAddress;

	/**
	 * 登录地点
	 */
	@Length(max = 100, message = "登录地点长度不能超过{max}")
	@Excel(name = "登录地点", width = 20d)
	@ApiModelProperty(value = "登录地点", position = 4)
	private String ipLocation;

	/**
	 * 浏览器
	 */
	@Length(max = 100, message = "浏览器长度不能超过{max}")
	@Excel(name = "浏览器", width = 20d)
	@ApiModelProperty(value = "浏览器", position = 7)
	private String browser;

	/**
	 * 操作系统
	 */
	@Length(max = 100, message = "操作系统长度不能超过{max}")
	@Excel(name = "操作系统", width = 20d)
	@ApiModelProperty(value = "操作系统", position = 8)
	private String os;

	/**
	 * 登录状态 [成功_1,失败_0]
	 */
	@NotNull(message = "请输入登录状态")
	@Excel(name = "登录状态", width = 20d, replace = { "成功_1", "失败_0" })
	@ApiModelProperty(value = "登录状态 [成功_1,失败_0]", required = true, position = 9)
	private Boolean status;

	/**
	 * 操作信息
	 */
	@Length(max = 1000, message = "操作信息长度不能超过{max}")
	@Excel(name = "操作信息", width = 20d)
	@ApiModelProperty(value = "操作信息", position = 10)
	private String msg;

	/**
	 * 应用主键
	 */
	@Length(max = 100, message = "应用主键长度不能超过{max}")
	@ExcelIgnore
	@Excel(name = "应用主键", width = 20d)
	@ApiModelProperty(value = "应用主键", position = 11)
	private String appId;

	/**
	 * 应用名称
	 */
	@Length(max = 100, message = "应用名称长度不能超过{max}")
	@Excel(name = "应用名称", width = 20d)
	@ApiModelProperty(value = "应用名称", position = 12)
	private String appName;

	/**
	 * 登录时间
	 */
	@Excel(name = "登录时间", width = 20d, exportFormat = Const.DEFAULT_DATETIME_PATTERN)
	@ApiModelProperty(value = "登录时间", position = 13)
	private Date operateDateTime;
}
